<template>
     <view class="content-vote-item">
      <u-image  :src="getImg('vote-image.png')"  width="278rpx" height="241rpx"/>
      <text class="content-vote-item-text">
        {{initiateText}}
      </text>
      <view class="content-vote-item-btn" @click="applyOpen">
        申请开通
      </view>
    </view>
</template>
<script>
import { mapState } from 'vuex' 
export default {
  name: 'UnauthVote',
  props: {
    type: {
      type: Number,
      default: 0
    }
  },
  computed: {
   ...mapState("community",["communityName","communityId"]),
   initiateText(){
    if(this.type==1){
      return "如果需发起投票，您可以申请开通服务"
    }else if(this.type==2){
      return "如果需发起快速决议，您可以申请开通服务"
    }else if(this.type==3){
      return "如果需发起问卷调查，您可以申请开通服务"
    }else if(this.type==4){
      return "如果需发起倡议书，您可以申请开通服务"
    }
   }
  },
  methods: {
    applyOpen(){
     
      uni.navigateTo({
        url: `/pages/joinTrial/index?name=${this.communityName}`
      })
    }
  }
}
</script>
<style lang="scss" scoped>

  .content-vote-item{
    width: 100%;
    box-shadow: 0rpx 34rpx 144rpx 0rpx rgba(58,76,130,0.08), 0rpx 5rpx 14rpx 0rpx rgba(169,194,209,0.1);
    background: #FFFFFF;
    border-radius: 18rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80rpx 23rpx;
    margin-top: 20rpx;
    &-text {
      font-weight: 400;
      font-size: 28rpx;
      color: #4A6279;
      text-align: center;
      margin-top: 40rpx;
    }
    &-btn {
      width: 100%;
      height: 81rpx;
      background: $uni-color-primary;
      border-radius: 12rpx;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 30rpx;
      color: #FFFFFF;
      margin-top: 40rpx;
    }
  }


</style>    